﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Task5
{
    class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Let's start something!");
            SelectAction();
            Console.ReadKey();
        }

        static void SelectAction()
        {
            Console.WriteLine("Please make your choice by pressing keys 1-4 on the keyboard.\nPress 1 to perform <action 1>.\nPress 2 to perform <action 2>.\nPress 3 to perform <action 3>.\nPress 4 to perform <action 4>.");
            int userChoice = Int32.Parse(Console.ReadLine());
            switch (userChoice)
            {
                case 1:
                    WriteHelloOnce();
                    break;
                case 2:
                    WriteHello4Times();
                    break;
                case 3:
                    CalculateSquares();
                    break;
                case 4:
                    CountElements();
                    break;
                case 5:
                    FindMaxNumber();
                    break;
                default:
                    Console.WriteLine("Sorry, invalid choice!");
                    break;
            }
        }
        static void WriteHelloOnce()
        {
            Console.WriteLine("Hello!");
        }
        static void WriteHello4Times()
        {
            for (int i = 1; i < 5; i++)
            {
                Console.WriteLine("Hello!");
            }
        }
        static void CalculateSquares()
        {
            for (int i = 10; i < 21; i++)
            {
                Console.WriteLine(i * i);
            }
        }
        static void CountElements()
        {
            Console.WriteLine("Enter a number");
            int inputNumber = Int32.Parse(Console.ReadLine());
            int counter = 1;
            while (inputNumber / 10 > 0)
            {
                inputNumber = inputNumber / 10;
                counter++;
            }
            Console.WriteLine(counter);
        }
        static void FindMaxNumber();
        {
            Console.WriteLine("Please enter 5 numbers separated by spaces");
            bool isFirstIteration = true;
            int number = Int32.Parse(Console.ReadLine());
            int maxNumber = Int32.MinValue;
            for (int i = 1, i <6; i++)
            {
                Console.WriteLine("Please enter number {0}", i);
                number = Int32.Parse(Console.ReadLine());
                if (number > maxNumber)
                {
                    maxNumber = number;
                }
                else
                {
                    continue;
                }
            }
            //if (isFirstIteration)
            //{
            //    maxNumber = number;
            //    isFirstIteration = false;
            //}
            //else
            //{
            //    if (number > maxNumber)
            //    {
            //        maxNumber = number;
            //    }
            //}
            //Console.WriteLine(maxNumber);
        }
    }
}
